<%@ page language="java" import="java.util.*" pageEncoding="UTF-8" %>
<%@ taglib prefix="s" uri="/struts-tags" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
    <jsp:include page="../common/header.jsp" />
    <script type="text/javascript">
        function btn1() {
            var $btn1 = $("input[name=btn1]");
            $btn1.bind("click", function () {
                $.ajax(
                        {
                            type: "get",
                            url: "scoreCountTest.action",
                            data: {
                                gradeID: $("#gradeID1").val(),
                                xueqi: $("#xueqi1").val(),
                                examType: $("#examType1").val()
                            },
                            dataType: "json",
                            success: login_Result,
                            error: function () {
                                alert("系统异常，请稍后重试！");
                            }
                        }
                );
                function login_Result(data) {
                    var d = eval("(" + data + ")");
                    if (d.flag == 0) {
                        alert("班级成绩录入不完整，暂时不能进行成绩统计工作");
                        return;
                    }
                    else {
                        $("#myForm1").submit();
                    }
                };
            });
        }
        $(function () {
            btn1();

        });
    </script>
    <jsp:include page="../common/mycss.jsp" />
</head>

<body>
<div class="lyear-layout-web">
    <div class="lyear-layout-container">
        <!--左侧导航-->
        <aside class="lyear-layout-sidebar">
            <!-- logo -->
            <div id="logo" class="sidebar-header">
                <jsp:include page="../common/title.jsp" />
            </div>
            <div class="lyear-layout-sidebar-scroll">
                <jsp:include page="../common/menu.jsp" />
            </div>
        </aside>
        <!--End 左侧导航-->
        <jsp:include page="../common/top.jsp" />
        <!--页面主要内容-->
        <main class="lyear-layout-content">
            <div class="container-fluid">
                <div class="row">
                    <div class="col-lg-12">
                        <div class="card">
                            <div class="card-toolbar clearfix">
                                <h5>成绩管理——成绩统计</h5>
                            </div>
                            <div class="card-body">
                                <div id="accordion">
                                    <div class="frame">
                                        <form action="scoreCountSuc.action" method="post" id="myForm1">
                                            <table class="datalist">
                                                <tr>
                                                    <td>班级：<select name="gradeID" id="gradeID1">
                                                        <s:iterator value="grades">
                                                            <option value='<s:property value="bianHao" />'><s:property value="year"/>届<s:property value="name"/>（<s:property
                                                                    value="classID"/>）班
                                                            </option>
                                                        </s:iterator>
                                                    </select>&nbsp;&nbsp;&nbsp;学期：<select name="xueqi" id="xueqi1">
                                                        <%--  <option value="1">1</option>
                                                          <option value="2">2</option>
                                                          <option value="3">3</option>
                                                          <option value="4">4</option>
                                                          <option value="5">5</option>
                                                          <option value="6">6</option>
                                                          <option value="7">7</option>
                                                          <option value="8">8</option>--%>
                                                        <jsp:include page="xueqi.jsp"/>
                                                    </select>&nbsp;&nbsp;&nbsp;类型：<select name="examType" id="examType1">
                                                        <option value="期中">期中</option>
                                                        <option value="期末">期末</option>
                                                    </select>&nbsp;&nbsp;&nbsp;<input type="button" name="btn1" value="查询-统计"/></td>
                                                </tr>
                                            </table>
                                        </form>

                                        <form action="scoreCountNianJi.action" method="post" id="myForm2">
                                            <table class="datalist">
                                                <tr>
                                                    <td>
                                                        年级（届）：<select name="nianJi" id="nianJiId">
                                                        <s:iterator value="years">
                                                            <option value="<s:property />"><s:property/> 届</option>
                                                        </s:iterator>
                                                    </select>&nbsp;&nbsp;&nbsp;学期：<select name="xueqi" id="xueQiId">
                                                        <%--  <option value="1">1</option>
                                                          <option value="2">2</option>
                                                          <option value="3">3</option>
                                                          <option value="4">4</option>
                                                          <option value="5">5</option>
                                                          <option value="6">6</option>
                                                          <option value="7">7</option>
                                                          <option value="8">8</option>--%>
                                                        <jsp:include page="xueqi.jsp"/>
                                                    </select>&nbsp;&nbsp;&nbsp;类型：<select name="examType" id="examTypeId">
                                                        <option value="期中">期中</option>
                                                        <option value="期末">期末</option>
                                                    </select>&nbsp;&nbsp;&nbsp;<input type="submit" name="btn2" value="查询-统计"/>
                                                    </td>
                                                </tr>
                                            </table>
                                        </form>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>

                </div>

            </div>

        </main>
        <!--End 页面主要内容-->
    </div>
</div>
</body>
</html>
